package com.qingcheng.controller.order.timed;


import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.order.CategoryReportService;
import com.qingcheng.service.order.OrderService;

import com.qingcheng.service.order.TradeStatisticsService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class TimedOrder {

   @Reference
   private OrderService orderService;

   @Reference
   private CategoryReportService categoryReportService;

   @Reference
   private TradeStatisticsService tradeStatisticsService;

    @Scheduled(cron = "0 * * * * ?")
    public void timed(){
        orderService.finishOrder();
        orderService.normalOrder();
        orderService.seckillOrder();
        orderService.sendOvertime();
        orderService.reputation();
    }

    @Scheduled(cron = "0 0 1 * * ?")
    public void categoryReportTimed(){
        categoryReportService.categoryTimed();
    }

    @Scheduled(cron ="0 0 1 * * ?" )
    public void tradeStatistics(){
        tradeStatisticsService.createTrade();
    }
}
